import numpy as np

def cal_polyfit(x,y,deg=2):
    # 拟合一个二次多项式
    coefficients = np.polyfit(x, y, deg)
    return coefficients

if __name__=="__main__":
    y = [0.35, 0.3, 0.25, 0.2, 0.15, 0.1]
    x = [31.7, 25.5, 15.5, 7.8, 2.9, 0.6]
    deg = 2
    abc=cal_polyfit(x,y,deg)
    print(abc)
